/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package guzik.lukasz.UsersExplorer;

import SnpDbEntities.Category;
import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Łukasz 'byku' Guzik
 */
public class ExtendedTableModel extends AbstractTableModel
{
    private String columnNames[] =
    {
	"", "Kategoria"
    };
    private ArrayList<Object[]> data = new ArrayList<Object[]>();

    @Override
    public int getRowCount()
    {
	return data.size();
    }

    @Override
    public int getColumnCount()
    {
	return columnNames.length;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex)
    {
	return data.get(rowIndex)[columnIndex];
    }

    @Override
    public Class<?> getColumnClass(int columnIndex)
    {
	return getValueAt(0, columnIndex).getClass();
    }

    void addRow(Category cat, boolean isModerated)
    {
	data.add(new Object[]{isModerated, cat});
    }

    @Override
    public String getColumnName(int column)
    {
	return columnNames[column];
    }
}
